/*
 * @Author: your name
 * @Date: 2021-07-21 10:01:43
 * @LastEditTime: 2021-07-26 10:57:57
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \STAMS\src\components\adminMenu.tsx
 */
import React from 'react';
import { Menu } from 'antd';
const { SubMenu } = Menu;
import {
  SolutionOutlined,
  MenuUnfoldOutlined,
  MenuFoldOutlined,
  UserOutlined,
  BookOutlined,
  TeamOutlined,
  LineChartOutlined,
  FormOutlined,
  CalendarOutlined,
} from '@ant-design/icons';
import { history, Link } from 'umi';

export default function AdminMenu() {
  return (
    <>
      <Menu
        mode="inline"
        defaultSelectedKeys={[history.location.pathname]}
        defaultOpenKeys={[
          history.location.pathname.slice(
            0,
            history.location.pathname.indexOf('/', 8),
          ),
        ]}
      >
        <Menu.Item key="/admin/userControl" icon={<UserOutlined />}>
          <Link to="/admin/userControl">用户管理</Link>
        </Menu.Item>
        <Menu.Item key="/admin/batchControl" icon={<UserOutlined />}>
          <Link to="/admin/batchControl">批次管理</Link>
        </Menu.Item>
         <Menu.Item key="/admin/courseControl" icon={<TeamOutlined />}>
          <Link to="/admin/courseControl">课程管理</Link>
        </Menu.Item>
        <Menu.Item key="/admin/topicControl" icon={<TeamOutlined />}>
          <Link to="/admin/topicControl">题库管理</Link>
        </Menu.Item>
        <Menu.Item key="/changePassword" icon={<TeamOutlined />}>
          <Link to="/changePassword">修改密码</Link>
        </Menu.Item>
      </Menu>
    </>
  );
}
